package com.dogcatfishdish.containers
{
	import flash.display.DisplayObject;
	
	
	/**
	 * Provides functionality to enable interaction with IScreenContext.
	 *
	 * @author benbeaumont
	 * 
	 */	
	public interface IScreen
	{
		
		/**
		 * Cleanup method called by the IScreenContext when the IScreen instance is removed.
		 */		
		function remove():void;
		
		/**
		 * Call made to reset the state of the screen. This is not called directly after the screen in instantiated, 
		 * but when the screen is added after being removed previously i.e. navigate away from the screen and return to it.
		 */		
		function add():void;
			
		/**
		 * An IScreenContext instance
		 * 
		 * @param context 
		 */		
		function set context(context:IScreenManager):void;
		
		/**
		 * Sets the content of the screen. This should be a instance of a DisplayObject subclass or Class, otherwise it will throw an error when trying to be instantiated.
		 * Classes are instantiated internally.
		 * @param value
		 * 
		 */		
		function set content(value:*):void;
		
		/**
		 * Returns the instantiated DisplayObject content for this screen. 
		 * @return 
		 * 
		 */		
		function get content():DisplayObject;
		
		/**
		 * If a Class was passed as the content, this is function is called when the Class is instantiated.
		 *  
		 * @param func An untyped object refering to the function. 
		 * If the content was passed as an object, or if the function is outside the object, then this should be a function reference (screen.onInitialise = someFunction;) 
		 * If a Class was passed, nd the function is of that Class, this should be the String name of the function (screen.onInitialise = "someFunction";)
		 */		
		function set onInitialise(func:*):void;
		
		/**
		 * A function called when the IScreen content is added to the display list.
		 *  
		 * @param func An untyped object refering to the function. 
		 * If the content was passed as an object, or if the function is outside the object, then this should be a function reference (screen.onInitialise = someFunction;) 
		 * If a Class was passed, nd the function is of that Class, this should be the String name of the function (screen.onInitialise = "someFunction";)
		 */	
		function set onAdd(func:*):void;
		
		/**
		 * If a Class was passed as the content, this is function is called when the Class is instantiated.
		 *  
		 * @param func An untyped object refering to the function. 
		 * If the content was passed as an object, or if the function is outside the object, then this should be a function reference (screen.onInitialise = someFunction;) 
		 * If a Class was passed, nd the function is of that Class, this should be the String name of the function (screen.onInitialise = "someFunction";)
		 */	
		function set onRemove(func:*):void;
		
	}
}